package com.smartleanx.module.hrm.intergration;

import com.smartleanx.module.system.api.dept.PostLevelApi;
import com.smartleanx.module.system.api.dept.dto.PostLevelRespDTO;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 岗级服务
 */
@Component
public class PostLevelServiceProvider {
    @Resource
    private PostLevelApi postLevelApi;

    public PostLevelRespDTO getPostLevel(Long id) {
        return postLevelApi.getPostLevelById(id).getCheckedData();
    }

    public Map<Long, PostLevelRespDTO> getPostLevelMap(Collection<Long> ids) {
        return postLevelApi.getPostLevelMap(ids);
    }

    public List<PostLevelRespDTO> getPostLevelList(Collection<Long> ids) {
        return postLevelApi.getPostLevelList(ids).getCheckedData();
    }

    public List<PostLevelRespDTO> getPostLevelList() {
        return postLevelApi.getAllList().getCheckedData();
    }

    public List<PostLevelRespDTO> getLevelListByPostId(Long postId) {
        return postLevelApi.getLevelListByPostId(postId).getCheckedData();
    }

    public Boolean deletePostLevel(Long id) {
        return postLevelApi.deletePostLevel(id).getCheckedData();
    }
}
